const {app} = require('electron');
const path = require('path');
const os_1 = require('os')
const BlogBase = require(path.join(os_1.homedir(), app.name,'blog_templates','BlogBase'))
const defaultHandler = new BlogBase()

exports.load = function (dataStore){
    let templateJs = dataStore.getTemplate() === undefined ? undefined : [dataStore.getTemplate()['path']]
    const TemplateBase = templateJs!==undefined ? require(templateJs[0]) : BlogBase
    return new TemplateBase(dataStore)
}
exports.defaultHandler = defaultHandler
